package com.think.teaching.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.think.teaching.mapper.VrmlTroomMapper;
import com.think.teaching.mapper.VrmlTroomResMapper;
import com.think.teaching.model.Asset;
import com.think.teaching.model.VrmlTroom;
import com.think.teaching.model.VrmlTroomRes;
import com.think.teaching.service.VrmlTroomResService;
import com.think.teaching.service.VrmlTroomService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 实训室申请  服务实现类
 * </p>
 *
 * @author think
 * @since 2024-07-11
 */
@Service
public class VrmlTroomResServiceImpl extends BaseServiceImpl<VrmlTroomResMapper, VrmlTroomRes> implements VrmlTroomResService {

    @Override
    public IPage<VrmlTroomRes> RoomResList(Integer id, Integer count, Integer page, Integer flag, Boolean tag) {
        QueryWrapper<VrmlTroomRes> queryWrapper = new QueryWrapper<>();
        if (flag != 0) {
            queryWrapper.eq("created_by", id);
            queryWrapper.eq("type", "1");
        }

        IPage<VrmlTroomRes> ipage = new Page<>(page, count);
        return this.page(ipage,queryWrapper);
    }
}
